{% extends "toast/base.template.html" %}
{% load toast_filters %}

{% block breadcrumbs %}
	<li><a href="/toast/meeting/view/{{ attendance.meeting.id }}">{{ attendance.meeting.name }}</a> <span class="divider">/</span></li>
	<li class="active">{{ attendance.member.first_name_first }}</li>
{% endblock %}


{% block sidecontent %}
	<div class="btn-toolbar">
		<div class="btn-group">
			<a class="btn active" href="/toast/attendance/view/{{ attendance.id }}">View</a>
			<a class="btn" href="/toast/attendance/edit/{{ attendance.id }}">Edit</a>
			<a class="btn confirm" href="/toast/attendance/delete/{{ attendance.id }}" message="Are you sure you want to delete {{ attendance.member.first_name_first }} from {{ attendance.meeting.name }}?">Delete</a>
		</div>
	</div>
	<p class="divider"></p>
	<h5>{{ attendance.meeting.name }}</h5>

	<form method="POST" action="/toast/participation/add/">
	{% csrf_token %}
		<h4>Add Participation</h4>
		<p class="divider"></p>
		<h6>{{ form.name.label }}</h6>
		{{ form.name }}
		<p class="text-error">{{ form.name.errors.as_text }}</p>

		<h6>{{ form.participation_type.label }}</h6>
		{{ form.participation_type }}
		<p class="text-error">{{ form.participation_type.errors.as_text }}</p>

		<input type="hidden" name="attendance" value="{{ attendance.id }}" />
		<input class="btn btn-primary" name="participation_add" type="submit" value="Add Participation" />
	</form>
{% endblock %}


{% block content %}
{% if list_of_participation %}
	<table class="table">
		<thead>
		<tr>
			<th>Name</th>
			<th>Participation Type</th>
			<th>Action(s)</th>
		</tr>
		</thead>

		<tbody>
		{% for participation in list_of_participation %}
		<tr>
			<td><a href="/toast/participation/view/{{ participation.id }}">{{ participation.name }}</a></td>
			<td>{{ participation.participation_type }}</td>
			<td>
			<div class="btn-group pull-right">
				<a class="btn btn-primary" href="#"><i class="icon-wrench icon-white"></i> Actions</a>
				<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="/toast/participation/view/{{ participation.id }}"><i class="icon-eye-open"></i> View</a></li>
					<li><a href="/toast/participation/edit/{{ participation.id }}"><i class="icon-pencil"></i> Edit</a></li>
					<li><a href="/toast/participation/delete/{{ participation.id }}" class="confirm" message="Are you sure you want to delete {{ participation.name }}?"><i class="icon-trash"></i> Delete</a></li>
				</ul>
			</div>
			<div class="clearfix"></div>
			</td>
		</tr>
		{% endfor %}
		</tbody>
	</table>
{% else %}
	<p class="text-info">No participations added to for this member.</p>
{% endif %}
{% endblock %}




